﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HFController;

namespace HFWebApp.Control
{
    public partial class c_LegalAffairsClass : System.Web.UI.UserControl
    {
        public int LegalAffairsID { get; set; }

        public int Count { get; set; }

        public string BoxStyle { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                rpt_legalAffairs.DataSource = LegalAffairsController.getController().getLegalAffairsBiglClass(Count, "LegalAffairsID=" + LegalAffairsID.ToString());
                rpt_legalAffairs.DataBind(); //执行绑定
            }
        }

        /// <summary>
        /// 在rpt_legalAffairs绑定的时候执行
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void rpt_legalAffairs_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            Label lblID =(Label)e.Item.FindControl("lblID");
            Repeater rpt = (Repeater)e.Item.FindControl("rpt1");
            int BigClassID = int.Parse(lblID.Text);
            //Response.Write(BigClassID);
            rpt.DataSource = LegalAffairsController.getController().getLegalAffairsSmallClassList(6, BigClassID);
            rpt.DataBind();
        }
    }
}